package object.obj3D.enemy;

import object.obj2D.bullet.IBullet;
import object.obj2D.bullet.MGunBullet;
import object.obj2D.bullet.Missile;
import object.obj2D.weapon.Gun;
import system.Camera;
import system.MyCamera;

public class Player{
	// level of player
	private int m_iLevel;
	
	// number of normal bullets
	private int m_iNumMachineBullet = 0;
	
	// number of fire bullets
	private int m_iNumFireBullet = 0;
	
	// number of missiles
	private int m_iNumMissile = 0;
	
	// Max HP
	private int m_iMaxHP;
	
	// CurrentHP
	private int m_iHP;
	
	// current gun
	private int m_iGunID = Gun.MACHINE_GUN;
	
	private int m_defaultMBulletDam  = 10;
	private int  m_defaultFBulletDam = 30;
	private int m_dedaultMissile = 50;
	private int m_score = 0;
	
	
	IBullet ShootMachineGun(float alpha, float beta, float distance){
		IBullet b =  new MGunBullet(MyCamera.getAlpha(), MyCamera.getBeta(), 20, m_defaultMBulletDam);
//		b.CheckCollision(s_level.getCharacterList()));
		return b;
	}
	
	IBullet ShootFireGun(float alpha, float beta, float distance){
		return null;
	}
	
	IBullet ShootMissile(){
		IBullet b = new Missile(Camera.GetAlpha(), Camera.GetBeta(), 0, m_dedaultMissile);
//		b.CheckCollision(s_level.getCharacterList()));
		return b;
	}
	
	public IBullet Fire(float alpha, float beta, float distance){
		switch (m_iGunID){
		case Gun.MACHINE_GUN:
			return ShootMachineGun(alpha, beta, distance);
		case Gun.FIRE_GUN:
			return ShootMachineGun(alpha, beta, distance);
		default:
			return ShootMachineGun(alpha, beta, distance);
		}
	}
	
	public void Injure(int HP){
		m_iHP -= HP;
	}
	
	// Add HP (when get heath items, such as.)
	public void Revive(int HP){
		m_iHP += HP;
	}
	
	
	public int GetCurrentHP(){
		return m_iHP;
	}
	
	public void SetCurrentHP(int HP){
		m_iHP = HP;
	}

	public void AddMachineBullet(int add) {
		m_iNumMachineBullet += add;
	}

	public int GetNumMachineBullet() {
		return m_iNumMachineBullet;
	}


	public int GetNumFireBullet() {
		return m_iNumFireBullet;
	}
	
	public void AddFireBullet(int add) {
		m_iNumFireBullet += add;
	}

	public int GetiNumMissile() {
		return m_iNumMissile;
	}
	
	public void AddMissile(int add) {
		m_iNumMissile += add;
	}
	
	public int GetCurrentGun(){
		return m_iGunID;
	}
	
	public void ChangeGun(int GunID){
		m_iGunID = GunID;
	}
	
	public int GetCurrentNumMGunBullet(){
		return m_iNumMachineBullet;
	}
	
	public int GetCurrentNumFGunBullet(){
		return m_iNumFireBullet;
	}
	
	public int GetCurrentNumMissile(){
		return m_iNumMissile;
	}

	public void setScore(int m_score) {
		this.m_score = m_score;
	}

	public int geScore() {
		return m_score;
	}
	
	

}
